home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / csim / source.lha / source / C++SIM / Examples / Breaks.h < prev    next >
C/C++ Source or Header  |  1993-06-14  |  643b  |  42 lines

  1. /*
  2.  * Copyright (C) 1993
  3.  *
  4.  * Department of Computing Science,
  5.  * The University,
  6.  * Newcastle upon Tyne,
  7.  * UK.
  8.  */
  9.  
  10. #ifndef BREAKS_H_
  11. #define BREAKS_H_
  12.  
  13. #ifndef RANDOM_H_
  14. #include <Random.h>
  15. #endif
  16.  
  17. #ifndef PROCESS_H_
  18. #include <Process.h>
  19. #endif
  20.  
  21.  
  22. /* Waits for a time interval drawn from the OperativeTime. Then kills of the
  23.  * Machine and waits for a time interval drawn from the RepairTime before
  24.  * restarting the Machine.
  25.  */
  26.  
  27. class Breaks : public Process
  28. {
  29. public:
  30.     Breaks ();
  31.     ~Breaks ();
  32.  
  33.     void Body ();
  34.  
  35. private:
  36.     UniformStream* RepairTime;
  37.     UniformStream* OperativeTime;
  38.     boolean interrupted_service;
  39. };
  40.  
  41. #endif
  42.